package com.redsoft.spirit.dao;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.NoRepositoryBean;

/**
 * @author 杨雷
 */
@NoRepositoryBean
public interface BaseRepository<T, ID extends Serializable> extends JpaRepository<T,ID>{
	public HashMap<String, Object> sqlQuery(String queryString, String countSql, Map<String, ?> values, int offset, int limit, String countName, String rowsName);
	
	public List<T> sqlQuery(String queryString, Map<String, ?> values);
	
	public List<T> sqlQuery(String queryString, Object ... values);
	
	public HashMap<String, Object> retrieve(String queryString, String countHql, Map<String, ?> values, int offset, int limit, String countName, String rowsName);
	
	public List<Object> sqlQueryNotFormat(String queryString, Map<String, ?> values);
	
	public List<Object> sqlQueryNotFormat(String queryString, Object ... values);

	public List sqlQueryMap(String queryString, Map<String, ?> values);
	public List sqlQueryMap(String queryString, Object ... values);
}
